package com.project.platform.mapper;

import com.project.platform.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    List<User> queryPage(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize, @Param("query") Map<String, Object> query);

    int queryCount(@Param("query") Map<String, Object> query);

    @Select("SELECT * FROM user")
    List<User> list();

    @Select("select * from user where username = #{username}")
    //@Select("SELECT * FROM user WHERE username LIKE CONCAT('%',#{username},'%') ")
    User selectByUsername(String username);

    @Select("SELECT * FROM user WHERE id = #{id}")
    User selectById(Integer id);

    @Select("select * from user where tel = #{tel}")
    User SelbyTelphone(String tel);


    int insert(User user);

    int update(User user);

    boolean delete(List<Integer> ids);


}
